Skip to content

Update color tokens #8977

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Update color tokens #8977

wants to merge 4 commits into from

Conversation

YohYamasaki
Copy link
Contributor

To provide a basis for building Tuta's design system, we will update the colour tokens to follow the colour rules of the Material 3 design system.

For the users with whitelabel customisation, we perform old/new colour token mapping to ease the migration process.

close #8965

@YohYamasaki YohYamasaki requested a review from charlag May 9, 2025 07:42
@YohYamasaki YohYamasaki added the ui visual glitches, missing buttons, wrong text... label May 9, 2025
@YohYamasaki YohYamasaki linked an issue May 9, 2025 that may be closed by this pull request
@YohYamasaki YohYamasaki force-pushed the update-color-tokens branch from d8d0ca4 to 681cd6a Compare May 16, 2025 08:13
@YohYamasaki YohYamasaki force-pushed the update-color-tokens branch from 681cd6a to b9bc862 Compare May 23, 2025 09:59
Copy link
Contributor

@charlag charlag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you!

* Since the number of new tokens is less than the number of old tokens, it is impossible to map all colors. Thus, this is just for mitigation purposes.
* This mapper could be removed after all users who have whitelabel color customization have migrated to the new color tokens.
*/
public static mapOldToNewColorTokens(customizations: Partial<ThemeCustomizations>): ThemeCustomizations {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

old customizations are not Partial<ThemeCustomizations> right? It is rather keyof typeof oldToNewColorTokenMap

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have noticed that the customisations that can be passed to mapOldToNewColorTokens can possibly be ThemeCustomizations or keyof typeof oldToNewColorTokenMap, so I updated it to be able to handle both. We could add a method to check whether the customisation contains the old tokens, and could check it before calling mapOldToNewColorTokens, but I think the current implementation is simpler and should be OK as it is.

error: SONNE,
surface: light_white,
surface_container: grey_lighter_4,
on_surface_fade: grey_lighter_0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where does on_surface_fade come from? Did we invent it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I created this since there was no token that matched the colour. It is mainly used for the icons for ColumnEmptyMessageBox, but it could not fit into any type of surface, surface container or outline. I don't think this is the best solution and it should only be used for migration purposes. When we update the colour themes, the icons should also be updated to match the M3 colour tokens. I have added a deprecated warning to the token for now.

@charlag
Copy link
Contributor

charlag commented May 30, 2025

Nice, thank you for the changes!

Replaced old color tokens with new tokens that follow the Material 3 Design system.
- Added mapper of new/old color tokens.
- Added a message to prompt admin users with whitelabel customisation to check and update their settings.
- Added deprecated comment for `on_surface_fade`
- Fix typings for `mapOldToNewColorTokens` and `mapNewToOldColorTokens`
- Fix comment for `UpdateColorCustomizationNews`
- Update color tokens for chips
- Remove duplicated `outline_variant` color token
@YohYamasaki YohYamasaki force-pushed the update-color-tokens branch from f75be00 to 09ab2ff Compare June 6, 2025 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ui visual glitches, missing buttons, wrong text...
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update color tokens
2 participants